from sqlmodel_serializers import SQLModelSerializer


from .models import Hero


class HeroUpdate(SQLModelSerializer):
    class Meta:
        model = Hero

        optional = '__all__'

        fields = ('name', 'secret_name', 'age')


class HeroRead(SQLModelSerializer):
    id: int
    full_name: str

    class Meta:
        model = Hero


class HeroCreate(SQLModelSerializer):
    class Meta:
        model = Hero

        fields = ('name', 'secret_name', 'age')
